using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._TopographicProductionTools._DataManagement._Geodatabase
{
    /// <summary>
    /// <para>Load Data</para>
    /// <para>Moves features from one schema to another by loading data from a source to a target workspace.   Data mapping rules described in a cross-reference database are applied during loading.</para>
    /// <para>通过将数据从源加载到目标工作空间，将功能从一个方案移动到另一个方案。  交叉引用数据库中描述的数据映射规则在加载期间应用。</para>
    /// </summary>    
    [DisplayName("Load Data")]
    public class LoadData : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public LoadData()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_cross_reference">
        /// <para>Input Cross-reference Database</para>
        /// <para>The path to a cross-reference database.</para>
        /// <para>交叉引用数据库的路径。</para>
        /// </param>
        /// <param name="_in_sources">
        /// <para>Input Sources</para>
        /// <para>A list of workspaces that contain the source features to load into the target workspace.</para>
        /// <para>包含要加载到目标工作空间中的源要素的工作空间列表。</para>
        /// </param>
        /// <param name="_in_target">
        /// <para>Input Target Workspace</para>
        /// <para>The target workspace that contains the schema referenced in the cross-reference database. Source features are loaded into this workspace.</para>
        /// <para>包含交叉引用数据库中引用的架构的目标工作区。源功能将加载到此工作空间中。</para>
        /// </param>
        public LoadData(object _in_cross_reference, List<object> _in_sources, object _in_target)
        {
            this._in_cross_reference = _in_cross_reference;
            this._in_sources = _in_sources;
            this._in_target = _in_target;
        }
        public override string ToolboxName => "Topographic Production Tools";

        public override string ToolName => "Load Data";

        public override string CallName => "topographic.LoadData";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_cross_reference, _in_sources, _in_target, _in_dataset_map_defs, _row_level_errors.GetGPValue(), _out_target];

        /// <summary>
        /// <para>Input Cross-reference Database</para>
        /// <para>The path to a cross-reference database.</para>
        /// <para>交叉引用数据库的路径。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Cross-reference Database")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_cross_reference { get; set; }


        /// <summary>
        /// <para>Input Sources</para>
        /// <para>A list of workspaces that contain the source features to load into the target workspace.</para>
        /// <para>包含要加载到目标工作空间中的源要素的工作空间列表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Sources")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_sources { get; set; }


        /// <summary>
        /// <para>Input Target Workspace</para>
        /// <para>The target workspace that contains the schema referenced in the cross-reference database. Source features are loaded into this workspace.</para>
        /// <para>包含交叉引用数据库中引用的架构的目标工作区。源功能将加载到此工作空间中。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Target Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_target { get; set; }


        /// <summary>
        /// <para>Dataset Mapping Definitions</para>
        /// <para>The source to target feature class mapping list. The format of this string is id | SourceDataset | TargetDataset | WhereClause | Subtype.</para>
        /// <para>源到目标要素类的映射列表。此字符串的格式为 id |源数据集 |目标数据集 |其中条款 |亚。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Dataset Mapping Definitions")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _in_dataset_map_defs { get; set; } = null;


        /// <summary>
        /// <para>Log row level errors</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the tool will log errors that occur while inserting new rows into feature classes and tables in the Input Target Workspace parameter.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Errors that occur during individual row-level inserts will be logged. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Errors that occur during individual row-level inserts will not be logged.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定工具是否记录在输入目标工作空间参数中的要素类和表中插入新行时发生的错误。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将记录在单个行级插入期间发生的错误。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会记录在单个行级插入期间发生的错误。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Log row level errors")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _row_level_errors_value _row_level_errors { get; set; } = _row_level_errors_value._true;

        public enum _row_level_errors_value
        {
            /// <summary>
            /// <para>ROW_LEVEL_ERROR_LOGGING</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ROW_LEVEL_ERROR_LOGGING")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_ROW_LEVEL_ERROR_LOGGING</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_ROW_LEVEL_ERROR_LOGGING")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Target Workspace</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Target Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_target { get; set; }


        public LoadData SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}